package com.nisure.common;

import org.springframework.web.bind.annotation.RestController;

import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;
@RestController
public class CreateJsonObject {
	private JSONObject header;
	private JSONObject body;
	private JSONObject params;
	private JSONObject totalJson = new JSONObject();
	
	public JSONObject getJsonData(String accessToken,JSONObject jsonParams){
		header = new JSONObject();
		params = new JSONObject();
		body = new JSONObject();
				
		params.put("token", CommonData.token);
		params.put("accessToken", accessToken);		
		header.put("header", params);
		
		
		body.put("body", jsonParams);
		totalJson.putAll(header);
		totalJson.putAll(body);
		
		
		
		//System.out.println("totalJson:"+JSONObject.toJSONString(totalJson, SerializerFeature.WriteMapNullValue));
		return totalJson;		
	}

}
